﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using System.Net;
using System.Net.Mail;

namespace AG.Apps.WebServices
{
    [DataContract]
    public class ValidationResult
    {
        [DataMember]
        public bool Validate;

        [DataMember]
        public string Name;
    }
    
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract(Namespace = "JsonpAjaxService")]
    public interface IUserData
    {
        [WebGet(UriTemplate = "/ProvideKeytoUser?UserEmail={UserEmail}&ProductName={ProductN}",
        ResponseFormat = WebMessageFormat.Json)]
        void ProvideKeytoUser(string UserEmail, string ProductN);

        /*[WebGet(UriTemplate = "/Validatekey?ProductName={ProductN}&ProductKey={ProductKey}",
        RequestFormat = WebMessageFormat.Json,
        ResponseFormat = WebMessageFormat.Json,
        BodyStyle = WebMessageBodyStyle.Bare)]
        bool ValidateKey(string ProductN, string ProductKey);*/

        [WebGet(UriTemplate = "/AddUser?UserName={UserN}&UserEmail={UserEmail}&ProductName={ProductN}&ProductKey={ProductKey}",
        ResponseFormat = WebMessageFormat.Json)]
        ValidationResult AddUser(string UserN, string UserEmail, string ProductN, string ProductKey);

        [WebGet(UriTemplate = "/TestKey",
        ResponseFormat = WebMessageFormat.Json)]
        void TestKey();

    }


    // Use a data contract as illustrated in the sample below to add composite types to service operations.
    /*[DataContract]
    public class CompositeType
    {
        bool boolValue = true;
        string stringValue = "Hello ";

        [DataMember]
        public bool BoolValue
        {
            get { return boolValue; }
            set { boolValue = value; }
        }

        [DataMember]
        public string StringValue
        {
            get { return stringValue; }
            set { stringValue = value; }
        }
    }*/
}
